package cn.easyutil.project.base.dto;

import cn.easyutil.project.base.bean.BaseBean;
import cn.easyutil.project.base.bean.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @Author: chen
 * @Date: 2019/4/8 9:47
 */
@ApiModel("分页+编号公共参数")
public class IdAndPageDto extends BaseBean {

    @ApiModelProperty(value = "编号",example="1")
    private Long id;

    @ApiModelProperty(value = "分页信息")
    private PageDto page;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    public Page getPage() {
        if(this.page == null){
            return null;
        }
        Page copy = new Page();
        copy.setCurrentPage(this.page.getCurrentPage());
        copy.setShowCount(this.page.getShowCount());
        return copy;
    }

    public void setPage(PageDto page) {
        this.page = page;
    }
}
